//
//  NSString+Size.h
//  IMIHome
//
//  Created by OrrHsiao on 2021/5/6.
//  Copyright © 2021 上海创米科技有限公司. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface NSString (Size)

/**
 获取文字高度

 @param text <#text description#>
 @param font <#font description#>
 @param width <#width description#>
 @return <#return value description#>
 */
+ (CGFloat)getStringHeightWithText:(NSString *)text font:(UIFont *)font viewWidth:(CGFloat)width;

/**
 获取文字宽度

 @param text <#text description#>
 @param font <#font description#>
 @param height <#height description#>
 @return <#return value description#>
 */
+ (CGFloat)getStringWidthWithText:(NSString *)text font:(UIFont *)font viewHeight:(CGFloat)height;

/// 计算富文本高度
/// @param attributedString <#attributedString description#>
/// @param width <#width description#>
/// @param font <#font description#>
+ (CGFloat)getAttributedStringHeightWithText:(NSAttributedString *)attributedString andWidth:(CGFloat)width andFont:(UIFont *)font;

@end

NS_ASSUME_NONNULL_END
